In a quantized congestion control technology (QCN, Quantized Congestion Notification protocol), a congestion reaction point (RP, Reaction Point) is disposed on a terminal device (station), where the RP is generally deployed in an output queue of the terminal device; a congestion detection point (CP, Congestion Point) is disposed in an egress port queue of a network device, and the CP determines, according to a cache consumption situation of the output queue, whether congestion occurs. If congestion is detected, a congestion notification message (CNM, Congestion Notification Message) including a congestion extent is constructed by using a sampling algorithm, and the CNM is sent to a source terminal that causes the congestion, so that the source terminal reduces a data transfer rate of a corresponding queue according to indication of the CNM. It can be learned that in the QCN in the prior art, a congestion source can be found relatively accurately, thereby resolving a technical problem of congestion.
However, the QCN in the prior art has a technical problem that reaction time is long and uncertain. To resolve this problem, priority-based flow control (PFC, Priority-based Flow Control) is introduced to the QCN in the prior art. PFC is an enhancement of a suspension mechanism in 802.3ad, where traffic is classified into traffic with 8 priorities according to a priority field of a virtual local area network identifier in the 802.1Q protocol, an independent suspension mechanism is separately implemented for traffic with each priority, and a PFC flow control frame is sent to a link peer end according to usage of a receiving cache of an input port, so as to instruct the peer end to suspend sending of network traffic with the priority. It can be learned that a reaction speed in the PFC is higher than that in the QCN.
For specific implementation of a QCN technology to which the PFC technology is introduced, refer to FIG. 1. It can be learned from a schematic diagram of a QCN device shown in FIG. 1, port 1 to port 4 are input ports, port 5 is an output port, and a CP is deployed in an output queue of port 5. In this solution, a technical problem that reaction time is long in a QCN technology to which the PFC is not introduced is resolved in the following manner:
All output packets sent by all output ports are monitored on the QCN device, and if an output packet is a CNM message frame, the port is triggered to send a PFC flow control frame that has a corresponding priority to a peer end of the port.
In the QCN technology to which the PFC is introduced, the technical problem that reaction time is long in the QCN technology to which the PFC is not introduced can be resolved; however, in this solution, a sampling manner is still needed to locate an RP, and a sampling algorithm of the QCN is relatively blind. Therefore, in a specific implementation process, possibly, a congestion source can be located to control congestion only after sampling is performed for many times and multiple CNMs are sent, so that CNM sampling time is relatively long, and time for generating a CNM is relatively long, thereby leading to a relatively low processing rate of a congestion problem.